package com.mmp.main.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.mmp.common.util.SearchRequired;

/**
 * The persistent class for the sp_inventory_content database table.
 *
 */
@Entity
@Table(name = "sp_inventory_content")
@NamedQuery(name = "SpInventoryContent.findAll", query = "SELECT s FROM SpInventoryContent s ORDER BY s.name")
public class SpInventoryContent implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Basic(optional = false)
	private Integer id;

	@ManyToOne
	@JoinColumn(name = "site_id")
	private Site site;

	@SearchRequired
	private String code;

	private String name;

	@Column(name = "available_quantity")
	private Integer availableQuantity;

	private Integer threshold;

	@Column(name = "avg_unit_price")
	private Float avgUnitPrice;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "created_in")
	private Date createdIn;

	@ManyToOne
	@JoinColumn(name = "created_by")
	private User createdBy;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "last_modefied_in")
	private Date lastModefiedIn;

	@ManyToOne
	@JoinColumn(name = "last_modefied_by")
	private User lastModefiedBy;

	transient Float minPrice;
	transient Float maxPrice;

	public SpInventoryContent() {
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Site getSite() {
		return site;
	}

	public void setSite(Site site) {
		this.site = site;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getAvailableQuantity() {
		return availableQuantity;
	}

	public void setAvailableQuantity(Integer availableQuantity) {
		this.availableQuantity = availableQuantity;
	}

	public Integer getThreshold() {
		return threshold;
	}

	public void setThreshold(Integer threshold) {
		this.threshold = threshold;
	}

	public Float getAvgUnitPrice() {
		return avgUnitPrice;
	}

	public void setAvgUnitPrice(Float avgUnitPrice) {
		this.avgUnitPrice = avgUnitPrice;
	}

	public Date getCreatedIn() {
		return createdIn;
	}

	public void setCreatedIn(Date createdIn) {
		this.createdIn = createdIn;
	}

	public User getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(User createdBy) {
		this.createdBy = createdBy;
	}

	public Date getLastModefiedIn() {
		return lastModefiedIn;
	}

	public void setLastModefiedIn(Date lastModefiedIn) {
		this.lastModefiedIn = lastModefiedIn;
	}

	public User getLastModefiedBy() {
		return lastModefiedBy;
	}

	public void setLastModefiedBy(User lastModefiedBy) {
		this.lastModefiedBy = lastModefiedBy;
	}

	public Float getMinPrice() {
		return minPrice;
	}

	public void setMinPrice(Float minPrice) {
		this.minPrice = minPrice;
	}

	public Float getMaxPrice() {
		return maxPrice;
	}

	public void setMaxPrice(Float maxPrice) {
		this.maxPrice = maxPrice;
	}

}
